<template>
	<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" style="height: 1300rpx;width: 750rpx;padding: 30rpx 0;" :lower-threshold="lower_threshold" refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="onRefresh" :refresher-threshold="0" @refresherpulling="pulling" refresher-background="#FF7300" >
		<view style="width: 750rpx;height: 500rpx;line-height: 500rpx;text-align: center; " v-if="biao_num == 2">
			暂无数据
		</view>
		<view style="width: 694rpx;margin-left: 27rpx;box-sizing: border-box;padding: 30rpx;background: #FFFFFF;border-radius: 30rpx;margin-bottom: 30rpx;" v-if="kechengping_list.length != 2" v-for="(itme,index) in kechengping_list" :key="index">
			<view style="margin-bottom: 20rpx;">
				 <textarea   placeholder-style="font-size:30.15rpx" style="font-size:30.15rpx;width: 598.42rpx;max-height: 100.5rpx;border: 0.6rpx solid #BFBFBF;border-radius: 12rpx;padding: 20rpx;letter-spacing: 1rpx;" v-model="itme.content" maxlength="1000" disabled/>
			</view>
			<view style="display: flex;margin-right: 30rpx;margin-bottom: 25rpx;">
				<view v-for="(itmes,indexs) in itme.img_list" :key="indexs" style="width: 70rpx;height: 70rpx;border-radius: 10rpx;">
					<image :src="itmes" style="width: 100rpx;height: 100rpx;border-radius: 10rpx;border: 0.5rpx solid #BEBEBE;"></image>
				</view>
			</view>
		</view>
	</scroll-view>
</template>
<script>
	export default {
		data(){
			return {
				currentPage: 1,
				master_id: "",
				kechengping_list: [],
				biao_num: 1,
				triggered: false,
				list_xian: "",
				content: "",
				xiala: 1
			}
		},
		methods:{
		async	shuju() {
				const res = await this.$myRequest({
					url: "/masterSummary/querySummaryList",
					data: {
						pageSize: 10,
						currentPage: this.currentPage,
						master_id: this.master_id,
						appointment_id: this.appointment_id,
						mechanism_id: this.mechanism_id
					}
				})
				if(res.code == 0){
					res.data.forEach((itme) => {
						if(itme.photo_url.indexOf(",") != -1){
							itme.img_list = itme.photo_url.split(",")
						}else{
							let data = []
							data.push(itme.photo_url)
							itme.img_list = data
						}
					})
					if(res.data.length < 10){
						this.xiala = 2
					}
					if(this.kechengping_list.length == 0){
						this.kechengping_list = res.data
					}else{
						this.kechengping_list = this.kechengping_list.concat(res.data)
					}
					if(this.kechengping_list.length == 0){
						this.biao_num = 2
					}
				}
				setTimeout(() => {
					this.triggered = false
				},10)
			},
			onRefresh(){
				uni.showLoading({
				    title: '加载中'
				})
				this.triggered = true
				this.currentPage = 1
				this.kechengping_list = []
				this.shuju()
				uni.hideLoading()
			},
			lower(){
				if(this.biao_num != 2){
					this.currentPage++
					this.shuju()
				}
			}
		},
		onLoad(option) {
			const val = JSON.parse(decodeURIComponent(option.num))
			this.master_id = val.master_id
			this.appointment_id = val.id
			this.mechanism_id = val.mechanism_id
			this.shuju()
		},
		onShow() {
			
		}
	}
</script>
<style lang="scss" scoped>
	
</style>